Repository navigation
Conversation
Amsterdam (EIP-8037) adds state gas for deployed code. The README describes how to get a gas limit that is high enough (ROUTE-2217).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: ROUTE-2217 (item 1).
The README has a new section for deployments on a chain that runs the Amsterdam (Glamsterdam) upgrade. EIP-8037 adds state gas for deployed code (1,530 gas per byte), so a large contract needs more than 2^24 gas. The
forge scriptsimulation uses the configuredevm_version(cancun in this repo) and sets a gas limit that is too low. The section says to add--skip-simulation, so forge takes each gas limit frometh_estimateGason the RPC node. It also says that--gas-limitsets the block gas limit of the local simulation, not the transaction gas limit, and that the deployer needs more ETH (37,435,950 gas with Amsterdam rules against 5,253,854 with Osaka rules for the example).The numbers come from a v4 PoolManager deployment through
forge scriptand the CREATE2 factory:--broadcast(local simulation, forge 1.5.0 and 1.8.6)--broadcast --skip-simulationI ran both on a mainnet fork with an anvil that applies the Amsterdam gas rules. Then I checked the same transaction with
eth_simulateV1on Sepolia (Geth v1.17.8, reth v2.7.0, v2.8.0 and v2.8.1). The real clients estimate 37,734,228 gas. The transaction succeeds at 1.3 times this value (49,054,496) and reverts at 7,256,884. I did not run the Universal Router deploy scripts themselves.--skip-simulationexists with the same behavior in Foundry 1.3.6 to 1.5.0 (crates/script/src/broadcast.rs).AI-Generated Description
Linear: ROUTE-2217 (item 1).
Summary
Adds a README section documenting how to deploy contracts on Ethereum L1 after the Amsterdam (Glamsterdam) upgrade.
Changes
README.md: New "Deploying on Ethereum L1 after the Amsterdam upgrade" section explaining that EIP-8037 adds state gas for deployed code (1,530 gas per byte), which pushes large contract deployments past the 2^24 gas threshold. Documents thatforge script's local simulation uses the configuredevm_version(older than Amsterdam), sets a gas limit that is too low, and causes the deployment to revert on chain. Recommends--skip-simulationso forge useseth_estimateGasfrom the RPC node. Clarifies that--gas-limitsets the block gas limit of the local simulation, not the transaction gas limit.Notes
forge scriptand the CREATE2 factory: 37,435,950 gas with Amsterdam rules vs 5,253,854 gas with Osaka ruleseth_simulateV1on Sepolia (Geth v1.17.8, reth v2.7.0–v2.8.1)